
	.global __puts
	.global __putc
	.global __println
	.global __clear_screen
	
	.type __puts, @function
	.type __putc, @function
	.type __println, @function
	.type __clear_screen, @function

	.code16
	.section .initlib
	
/* 打印字符串 */
__puts:
	pusha
	xor	%bh, %bh
.loop:
	lodsb
	test	%al, %al
	jz	.done
	movb	$0x0e, %ah
	int	$0x10
	jmp	.loop
.done:	
	popa
	ret


/* 将 al 打印出来 */
__putc:
	push	%bx
	push	%ax
	xor	%bh, %bh
	movb	$0x0e, %ah
	int 	$0x10
	pop	%ax
	pop	%bx
	ret

__println:
	push 	%si
	mov	$13, %al
	call	__putc
	mov	$10, %al
	call	__putc
	pop	%si
	ret


/* clean screen */
__clear_screen:
	pusha
	mov	$0x0600, %ax
	xor	%cx, %cx
	xor	$0x0f, %bh
	mov	$24, %dh
	mov	$79, %dl
	int 	$0x10

